//
//  AUHomeViewController.swift
//  AwesomeUHomeModule_Example
//
//  Created by Miss_Special on 2018/4/11.
//  Copyright © 2018 CocoaPods. All rights reserved.
//

import UIKit
import AwesomeUBaseModule

public class AUHomeViewController: UIViewController {
    
    fileprivate var button: UIButton = {
        let button = UIButton()
        button.setTitle("测试按钮", for: .normal)
        button.frame.size = CGSize(width: 100, height: 60)
        button.setTitleColor(UIColor.blue, for: .normal)
        button.backgroundColor = UIColor.yellow
        button.addTarget(self, action: #selector(testButtonAction), for: .touchUpInside)
        return button
    }()

    override public func viewDidLoad() {
        super.viewDidLoad()
        
        navigationItem.title = "我是测试首页"
        view.backgroundColor = UIColor.au_randomColor()
        
        setupUI()
    }

}

extension AUHomeViewController {
    /// 设置UI
    fileprivate func setupUI() {
        
        // 添加
        view.addSubview(button)
        
        // 定位
        button.center = view.center
    }
}

extension AUHomeViewController {
    @objc public func testButtonAction(_ something: String) {
//        AUHomeModule.sharedHomeModule.testActionCallback?()
        print(something)
    }
}
